/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * BillScreen.java
 *
 * Created on 05 29, 11, 5:00:28 PM
 */
package vera;

import javax.swing.DefaultCellEditor;
import javax.swing.JComboBox;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.TableColumnModel;

/**
 *
 * @author kasia
 */
public class BillScreen extends ParentClass {

    /** Creates new form BillScreen */
    public BillScreen() {
        initComponents();
                
        JComboBox comboBox = new JComboBox();
        comboBox.addItem("Retainer");
        comboBox.addItem("Tax");
        comboBox.addItem("Other");
        comboBox.setEditable(false);
        DefaultCellEditor editor = new DefaultCellEditor(comboBox);
        
        // Assign the editor to the second column
        TableColumnModel tcm = m_tableAccountables.getColumnModel();
        tcm.getColumn(0).setCellEditor(editor);
        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        m_labelCreateBill = new javax.swing.JLabel();
        m_labelBillNo = new javax.swing.JLabel();
        m_labelClient = new javax.swing.JLabel();
        m_textFieldBillNo = new javax.swing.JTextField();
        m_labelDescription = new javax.swing.JLabel();
        m_textFieldDescription = new javax.swing.JTextField();
        m_textFieldClient = new javax.swing.JTextField();
        m_labelAccountables = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        m_tableAccountables = new javax.swing.JTable();
        m_labelVatAmount = new javax.swing.JLabel();
        m_textFieldVatAmount = new javax.swing.JTextField();
        m_labelDateCreated = new javax.swing.JLabel();
        m_labelTotal = new javax.swing.JLabel();
        m_textFieldTotal = new javax.swing.JTextField();
        m_buttonCreate = new javax.swing.JButton();
        m_buttonCancel = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setName("Form"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(vera.VERAApp.class).getContext().getResourceMap(BillScreen.class);
        m_labelCreateBill.setFont(resourceMap.getFont("m_labelCreateBill.font")); // NOI18N
        m_labelCreateBill.setText(resourceMap.getString("m_labelCreateBill.text")); // NOI18N
        m_labelCreateBill.setName("m_labelCreateBill"); // NOI18N

        m_labelBillNo.setText(resourceMap.getString("m_labelBillNo.text")); // NOI18N
        m_labelBillNo.setName("m_labelBillNo"); // NOI18N

        m_labelClient.setText(resourceMap.getString("m_labelClient.text")); // NOI18N
        m_labelClient.setName("m_labelClient"); // NOI18N

        m_textFieldBillNo.setText(resourceMap.getString("m_textFieldBillNo.text")); // NOI18N
        m_textFieldBillNo.setName("m_textFieldBillNo"); // NOI18N

        m_labelDescription.setText(resourceMap.getString("m_labelDescription.text")); // NOI18N
        m_labelDescription.setName("m_labelDescription"); // NOI18N

        m_textFieldDescription.setText(resourceMap.getString("m_textFieldDescription.text")); // NOI18N
        m_textFieldDescription.setName("m_textFieldDescription"); // NOI18N

        m_textFieldClient.setText(resourceMap.getString("m_textFieldClient.text")); // NOI18N
        m_textFieldClient.setName("m_textFieldClient"); // NOI18N

        m_labelAccountables.setText(resourceMap.getString("m_labelAccountables.text")); // NOI18N
        m_labelAccountables.setName("m_labelAccountables"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        m_tableAccountables.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Type", "Description", "Amount"
            }
        ));
        m_tableAccountables.setName("m_tableAccountables"); // NOI18N
        jScrollPane1.setViewportView(m_tableAccountables);

        m_labelVatAmount.setText(resourceMap.getString("m_labelVatAmount.text")); // NOI18N
        m_labelVatAmount.setName("m_labelVatAmount"); // NOI18N

        m_textFieldVatAmount.setText(resourceMap.getString("m_textFieldVatAmount.text")); // NOI18N
        m_textFieldVatAmount.setName("m_textFieldVatAmount"); // NOI18N

        m_labelDateCreated.setText(resourceMap.getString("m_labelDateCreated.text")); // NOI18N
        m_labelDateCreated.setName("m_labelDateCreated"); // NOI18N

        m_labelTotal.setText(resourceMap.getString("m_labelTotal.text")); // NOI18N
        m_labelTotal.setName("m_labelTotal"); // NOI18N

        m_textFieldTotal.setText(resourceMap.getString("m_textFieldTotal.text")); // NOI18N
        m_textFieldTotal.setName("m_textFieldTotal"); // NOI18N

        m_buttonCreate.setText(resourceMap.getString("m_buttonCreate.text")); // NOI18N
        m_buttonCreate.setName("m_buttonCreate"); // NOI18N

        m_buttonCancel.setText(resourceMap.getString("m_buttonCancel.text")); // NOI18N
        m_buttonCancel.setName("m_buttonCancel"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(47, 47, 47)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(m_labelDateCreated)
                    .addComponent(m_labelCreateBill)
                    .addComponent(m_labelClient)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(m_labelDescription)
                            .addComponent(m_labelBillNo)
                            .addComponent(m_labelAccountables)
                            .addComponent(m_labelVatAmount))
                        .addGap(28, 28, 28)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(m_textFieldClient, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 725, Short.MAX_VALUE)
                            .addComponent(m_textFieldDescription, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 725, Short.MAX_VALUE)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 725, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(m_textFieldVatAmount, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 393, Short.MAX_VALUE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                        .addComponent(m_buttonCreate)
                                        .addGap(18, 18, 18)
                                        .addComponent(m_buttonCancel))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(m_labelTotal)
                                        .addGap(35, 35, 35)
                                        .addComponent(m_textFieldTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addComponent(m_textFieldBillNo, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(136, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addComponent(m_labelCreateBill)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(m_labelBillNo, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(m_textFieldBillNo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(m_labelClient)
                    .addComponent(m_textFieldClient, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(m_labelDescription)
                    .addComponent(m_textFieldDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(m_labelAccountables)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(25, 25, 25)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(m_labelVatAmount)
                    .addComponent(m_labelTotal)
                    .addComponent(m_textFieldTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(m_textFieldVatAmount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 200, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(m_labelDateCreated)
                    .addComponent(m_buttonCancel)
                    .addComponent(m_buttonCreate))
                .addGap(34, 34, 34))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new BillScreen().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton m_buttonCancel;
    private javax.swing.JButton m_buttonCreate;
    private javax.swing.JLabel m_labelAccountables;
    private javax.swing.JLabel m_labelBillNo;
    private javax.swing.JLabel m_labelClient;
    private javax.swing.JLabel m_labelCreateBill;
    private javax.swing.JLabel m_labelDateCreated;
    private javax.swing.JLabel m_labelDescription;
    private javax.swing.JLabel m_labelTotal;
    private javax.swing.JLabel m_labelVatAmount;
    private javax.swing.JTable m_tableAccountables;
    private javax.swing.JTextField m_textFieldBillNo;
    private javax.swing.JTextField m_textFieldClient;
    private javax.swing.JTextField m_textFieldDescription;
    private javax.swing.JTextField m_textFieldTotal;
    private javax.swing.JTextField m_textFieldVatAmount;
    // End of variables declaration//GEN-END:variables
}
